package com.jiale.ojsystem.judge;

import com.jiale.ojsystem.model.dto.questionsubmit.JudgeInfo;
import org.springframework.stereotype.Service;

/**
 * 判题策略管理类
 */
@Service
public class JudgeStrategyManager {
    public JudgeInfo doJudge(JudgeContext judgeContext){
        String language = judgeContext.getLanguage();
        JudgeStrategy judgeStrategy=new DefaultJudgeStrategy();
        if(language.equals("java")){
            judgeStrategy =new JavaJudgeStrategy();
        }
        return judgeStrategy.doJudge(judgeContext);
    }
}
